﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;

namespace NLBS.Urls
{
    /// <summary>
    /// Provides a way to use alternative directories as Locations
    /// </summary>
    public class ApplicationKeyMapping
    {
        public ApplicationKeyMapping(string locationName, string pattern)
        {
            _locationName = locationName;
            regex = new Regex(pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
        }

        private string _locationName = null;
        private Regex regex = null;

        public string LocationName
        {
            get { return _locationName; }
        }

        public bool IsMatch(string url)
        {
            return regex.IsMatch(url);
        }

    }
}
